﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows.Input;
using ContactTracing.Core;
using ContactTracing.ViewModel.Events;

namespace ContactTracing.ViewModel
{
    public class CaseViewModel : ObservableObject, IDataErrorInfo, IDisposable
    {
        #region Members
        public Case Case;
        private ObservableCollection<ContactViewModel> _contacts = new ObservableCollection<ContactViewModel>();
        private bool _isInvalidId = false;
        private bool _isDuplicateId = false;
        #endregion // Members

        #region Static Members
        public static string Confirmed = String.Empty;
        public static string Probable = String.Empty;
        public static string Suspect = String.Empty;
        public static string NotCase = String.Empty;

        public static string Male = String.Empty;
        public static string Female = String.Empty;

        public static string MaleAbbr = String.Empty;
        public static string FemaleAbbr = String.Empty;
        #endregion // Static Members

        #region Static Properties
        public static List<string> IDPrefixes = new List<string>() { "ABC" };
        public static string IDSeparator = "-";
        public static string IDPattern = "###";
        #endregion // Static Properties

        #region Properties

        public bool IsInvalidId
        {
            get { return this._isInvalidId; }
            set
            {
                if (IsInvalidId != value)
                {
                    this._isInvalidId = value;
                    RaisePropertyChanged("IsInvalidId");
                }
            }
        }

        public bool IsDuplicateId
        {
            get { return this._isDuplicateId; }
            set
            {
                if (IsDuplicateId != value)
                {
                    this._isDuplicateId = value;
                    RaisePropertyChanged("IsDuplicateId");
                }
            }
        }

        public bool IsLocked
        {
            get
            {
                return Case.IsLocked;
            }
            set
            {
                if (Case.IsLocked != value)
                {
                    Case.IsLocked = value;
                    RaisePropertyChanged("IsLocked");
                }
            }
        }
        public string Error
        {
            get { return String.Empty; }
        }

        public string this[string columnName]
        {
            get
            {
                String errorMessage = String.Empty;
                switch (columnName)
                {
                    case "ID":
                        if (!ID.Contains(CaseViewModel.IDSeparator))
                        {
                            errorMessage = "The case ID field is incorrectly formatted. The separator character '" + CaseViewModel.IDSeparator + "' is required.";
                        }
                        else
                        {
                            int position = ID.IndexOf(IDSeparator);
                            string prefix = ID.Substring(0, position);
                            int prefixLength = prefix.Length;

                            string pattern = ID.Substring(position + 1);

                            double caseNumber = -1;
                            bool success = double.TryParse(pattern, out caseNumber);

                            //if (prefixLength != IDPrefix.Length)
                            //{
                            //    errorMessage = "The ID prefix has an incorrect length. Please ensure you are using the ID format " + IDPrefix + IDSeparator + IDPattern;
                            //}
                            //else if (prefix != IDPrefix)
                            //{
                            //    errorMessage = "The ID prefix is incorrect. Please ensure you are using the ID format " + IDPrefix + IDSeparator + IDPattern;
                            //}
                            //else if (!success)
                            //{
                            //    errorMessage = "The ID suffix must be a valid number. Please ensure you are using the ID format " + IDPrefix + IDSeparator + IDPattern;
                            //}
                            //else if (pattern.Length != CaseViewModel.IDPattern.Length)
                            //{
                            //    errorMessage = "The ID suffix does not have a valid number of characters. Please ensure you are using the ID format " + IDPrefix + IDSeparator + IDPattern;
                            //}
                        }
                        if (String.IsNullOrEmpty(ID))
                        {
                            errorMessage = "First Name is required";
                        }
                        break;
                    case "EpiCaseDef":
                        if (String.IsNullOrEmpty(EpiCaseDef))
                        {
                            errorMessage = "Epi case classification is required.";
                        }
                        break;
                    case "Age":
                        if (Age < 0)
                        {
                            errorMessage = "Age in cannot be less than zero.";
                        }
                        break;
                    case "DateReport":
                        if(DateReport.HasValue && DateReport.Value > DateTime.Now)
                        {
                            errorMessage = "The report date cannot be greater than current date.";
                        }
                        break;
                    case "DateOnset":
                    case "DateDeath":
                        if (DateOnset.HasValue && DateDeath.HasValue && DateOnset.Value > DateDeath.Value)
                        {
                            errorMessage = "The date of onset of symptoms cannot occur after the date of death.";
                        }
                        break;
                    case "DateDeath2":
                        if (DateOnset.HasValue && DateDeath2.HasValue && DateOnset.Value > DateDeath2.Value)
                        {
                            errorMessage = "The date of onset of symptoms cannot occur after the final date of death.";
                        }
                        break;
                    case "DateDischargeIso":
                    case "DateHospitalCurrentAdmit":
                        if (DateDischargeIso.HasValue && DateHospitalCurrentAdmit.HasValue && DateHospitalCurrentAdmit.Value > DateDischargeIso.Value)
                        {
                            errorMessage = "The date of hospitalization should not exceed the date the patient was isolated.";
                        }
                        break;

                }
                return errorMessage;
            }
        }

        public ObservableCollection<ContactViewModel> Contacts
        {
            get { return _contacts; }
            private set
            {
                if (_contacts != value)
                {
                    _contacts = value;
                    RaisePropertyChanged("Contacts");
                }
            }
        }
        public string RecordId
        {
            get { return Case.RecordId; }
            set
            {
                if (Case.RecordId != value)
                {
                    Case.RecordId = value;
                    RaisePropertyChanged("RecordId");
                }
            }
        }
        public string ID { get { return Case.ID; } 
            set 
            {
                if (Case.ID != value)
                {
                    if (CaseIDChanging != null)
                    {
                        CaseIDChanging(this, new FieldValueChangingEventArgs(Case.ID, value));
                    }
                    Case.ID = value;
                    RaisePropertyChanged("ID");
                }
            } 
        }
        public string Surname
        {
            get { return Case.Surname; }
            set
            {
                if (Case.Surname != value)
                {
                    Case.Surname = value;
                    RaisePropertyChanged("Surname");
                }
            }
        }
        public string OtherNames
        {
            get { return Case.OtherNames; }
            set
            {
                if (Case.OtherNames != value)
                {
                    Case.OtherNames = value;
                    RaisePropertyChanged("OtherNames");
                }
            }
        }
        public string EpiCaseDef
        {
            get { return Case.EpiCaseDef; }
            set
            {
                if (Case.EpiCaseDef != value)
                {
                    if (EpiCaseDefinitionChanging != null)
                    {
                        EpiCaseDefinitionChanging(this, new EpiCaseDefinitionChangingEventArgs(Case.EpiCaseDef, value));
                    }

                    Case.EpiCaseDef = value;
                    RaisePropertyChanged("EpiCaseDef");
                }
            }
        }
        public string RecordStatus
        {
            get { return Case.RecordStatus; }
            set
            {
                if (Case.RecordStatus != value)
                {
                    Case.RecordStatus = value;
                    RaisePropertyChanged("RecordStatus");
                }
            }
        }
        public DateTime? DateReport
        {
            get { return Case.DateReport; }
            set
            {
                if (Case.DateReport != value)
                {
                    Case.DateReport = value;
                    RaisePropertyChanged("DateReport");
                }
            }
        }
        public string Gender
        {
            get { return Case.Gender; }
            set
            {
                if (Case.Gender != value)
                {
                    Case.Gender = value;
                    RaisePropertyChanged("Gender");
                }
            }
        }
        public double? Age
        {
            get { return Case.Age; }
            set
            {
                if (Case.Age != value)
                {
                    Case.Age = value;
                    RaisePropertyChanged("Age");
                    RaisePropertyChanged("AgeYears");
                }
            }
        }
        public double? AgeYears { get { return Case.AgeYears; } }
        public AgeUnits? AgeUnit
        {
            get { return Case.AgeUnit; }
            set
            {
                if (Case.AgeUnit != value)
                {
                    Case.AgeUnit = value;
                    RaisePropertyChanged("AgeUnit");
                }
            }
        }
        public DateTime? DateOnset
        {
            get { return Case.DateOnset; }
            set
            {
                if (Case.DateOnset != value)
                {
                    Case.DateOnset = value;
                    RaisePropertyChanged("DateOnset");
                }
            }
        }
        public string HeadOfHousehold
        {
            get { return Case.HeadOfHousehold; }
            set
            {
                if (Case.HeadOfHousehold != value)
                {
                    Case.HeadOfHousehold = value;
                    RaisePropertyChanged("HeadOfHousehold");
                }
            }
        }
        public string Village
        {
            get { return Case.Village; }
            set
            {
                if (Case.Village != value)
                {
                    Case.Village = value;
                    RaisePropertyChanged("Village");
                }
            }
        }
        public string VillageOnset
        {
            get { return Case.VillageOnset; }
            set
            {
                if (Case.VillageOnset != value)
                {
                    Case.VillageOnset = value;
                    RaisePropertyChanged("VillageOnset");
                }
            }
        }
        public string VillageHosp
        {
            get { return Case.VillageHosp; }
            set
            {
                if (Case.VillageHosp != value)
                {
                    Case.VillageHosp = value;
                    RaisePropertyChanged("VillageHosp");
                }
            }
        }
        public string SubCounty
        {
            get { return Case.SubCounty; }
            set
            {
                if (Case.SubCounty != value)
                {
                    Case.SubCounty = value;
                    RaisePropertyChanged("SubCounty");
                }
            }
        }
        public string Parish
        {
            get { return Case.Parish; }
            set
            {
                if (Case.Parish != value)
                {
                    Case.Parish = value;
                    RaisePropertyChanged("Parish");
                }
            }
        }
        public string SubCountyOnset
        {
            get { return Case.SubCountyOnset; }
            set
            {
                if (Case.SubCountyOnset != value)
                {
                    Case.SubCountyOnset = value;
                    RaisePropertyChanged("SubCountyOnset");
                }
            }
        }
        public string SubCountyHosp
        {
            get { return Case.SubCountyHosp; }
            set
            {
                if (Case.SubCountyHosp != value)
                {
                    Case.SubCountyHosp = value;
                    RaisePropertyChanged("SubCountyHosp");
                }
            }
        }
        public string CountryHosp
        {
            get { return Case.CountryHosp; }
            set
            {
                if (Case.CountryHosp != value)
                {
                    Case.CountryHosp = value;
                    RaisePropertyChanged("CountryHosp");
                }
            }
        }
        public string District
        {
            get { return Case.District; }
            set
            {
                if (Case.District != value)
                {
                    Case.District = value;
                    RaisePropertyChanged("District");
                }
            }
        }
        public string DistrictOnset
        {
            get { return Case.DistrictOnset; }
            set
            {
                if (Case.DistrictOnset != value)
                {
                    Case.DistrictOnset = value;
                    RaisePropertyChanged("DistrictOnset");
                }
            }
        }
        public string DistrictHosp
        {
            get { return Case.DistrictHosp; }
            set
            {
                if (Case.DistrictHosp != value)
                {
                    Case.DistrictHosp = value;
                    RaisePropertyChanged("DistrictHosp");
                }
            }
        }
        public string Country
        {
            get { return Case.Country; }
            set
            {
                if (Case.Country != value)
                {
                    Case.Country = value;
                    RaisePropertyChanged("Country");
                }
            }
        }
        public string CountryOnset
        {
            get { return Case.CountryOnset; }
            set
            {
                if (Case.CountryOnset != value)
                {
                    Case.CountryOnset = value;
                    RaisePropertyChanged("CountryOnset");
                }
            }
        }
        public DateTime? DateIsolationCurrent
        {
            get { return Case.DateIsolationCurrent; }
            set
            {
                if (Case.DateIsolationCurrent != value)
                {
                    Case.DateIsolationCurrent = value;
                    RaisePropertyChanged("DateIsolationCurrent");
                }
            }
        }
        public DateTime? DateDischargeIso
        {
            get { return Case.DateDischargeIso; }
            set
            {
                if (Case.DateDischargeIso != value)
                {
                    Case.DateDischargeIso = value;
                    RaisePropertyChanged("DateDischargeIso");
                }
            }
        }
        public DateTime? DateHospitalCurrentAdmit
        {
            get { return Case.DateHospitalCurrentAdmit; }
            set
            {
                if (Case.DateHospitalCurrentAdmit != value)
                {
                    Case.DateHospitalCurrentAdmit = value;
                    RaisePropertyChanged("DateHospitalCurrentAdmit");
                }
            }
        }
        public DateTime? DateDeath
        {
            get { return Case.DateDeath; }
            set
            {
                if (Case.DateDeath != value)
                {
                    Case.DateDeath = value;
                    RaisePropertyChanged("DateDeath");
                }
            }
        }
        public bool DateDeathEst { get { return Case.DateDeathEst; } set { if (Case.DateDeathEst != value) { Case.DateDeathEst = value; RaisePropertyChanged("DateDeathEst"); } } }
        public bool DateOnsetEst { get { return Case.DateOnsetEst; } set { if (Case.DateOnsetEst != value) { Case.DateOnsetEst = value; RaisePropertyChanged("DateOnsetEst"); } } }
        public string DateOnsetEstExplain { get { return Case.DateOnsetEstExplain; } set { if (Case.DateOnsetEstExplain != value) { Case.DateOnsetEstExplain = value; RaisePropertyChanged("DateOnsetEstExplain"); } } }
        public string FinalStatus
        {
            get { return Case.FinalStatus; }
            set
            {
                if (Case.FinalStatus != value)
                {
                    Case.FinalStatus = value;
                    RaisePropertyChanged("FinalStatus");
                }
            }
        }
        public string CurrentStatus
        {
            get { return Case.CurrentStatus; }
            set
            {
                if (Case.CurrentStatus != value)
                {
                    Case.CurrentStatus = value;
                    RaisePropertyChanged("CurrentStatus");
                }
            }
        }

        //public string LocalizedCurrentStatus
        //{
        //    get 
        //    {
        //        if (System.Threading.Thread.CurrentThread.CurrentCulture.ToString().Contains("fr"))
        //        {
        //            switch (CurrentStatus)
        //            {
        //                case "Alive":
        //                    return "Vivant";
        //                case "Dead":
        //                    return "Décédé";
        //                default:
        //                    return CurrentStatus;
        //            }
        //        }
        //        else
        //        {
        //            return CurrentStatus;
        //        }
        //    }
        //}

        public string FinalLabClass
        {
            get { return Case.FinalLabClass; }
            set
            {
                if (Case.FinalLabClass != value)
                {
                    Case.FinalLabClass = value;
                    RaisePropertyChanged("FinalLabClass");
                }
            }
        }
        public string IsolationCurrent
        {
            get { return Case.IsolationCurrent; }
            set
            {
                if (Case.IsolationCurrent != value)
                {
                    Case.IsolationCurrent = value;
                    RaisePropertyChanged("IsolationCurrent");
                }
            }
        }
        public bool IsActive
        {
            get { return true; }
        }
        public bool IsContact
        {
            get { return Case.IsContact; }
            set
            {
                if (Case.IsContact != value)
                {
                    Case.IsContact = value;
                    RaisePropertyChanged("IsContact");
                    RaisePropertyChanged("IsContactSymbol");
                }
            }
        }
        
        public string IsContactSymbol { get { return Case.IsContactSymbol; } }

        public bool? IsHCW
        {
            get { return Case.IsHCW; }
            set
            {
                if (Case.IsHCW != value)
                {
                    Case.IsHCW = value;
                    RaisePropertyChanged("IsHCW");
                }
            }
        }
        public string PlaceOfDeath
        {
            get { return Case.PlaceOfDeath; }
            set
            {
                if (Case.PlaceOfDeath != value)
                {
                    Case.PlaceOfDeath = value;
                    RaisePropertyChanged("PlaceOfDeath");
                }
            }
        }
        public DateTime? DateLastLabSampleTested
        {
            get { return Case.DateLastLabSampleTested; }
            set
            {
                if (Case.DateLastLabSampleTested != value)
                {
                    Case.DateLastLabSampleTested = value;
                    RaisePropertyChanged("DateLastLabSampleTested");
                }
            }
        }
        public DateTime? DateLastLabSampleCollected
        {
            get { return Case.DateLastLabSampleCollected; }
            set
            {
                if (Case.DateLastLabSampleCollected != value)
                {
                    Case.DateLastLabSampleCollected = value;
                    RaisePropertyChanged("DateLastLabSampleCollected");
                }
            }
        }
        public string LastSampleInterpretation
        {
            get { return Case.LastSampleInterpretation; }
            set
            {
                if (Case.LastSampleInterpretation != value)
                {
                    Case.LastSampleInterpretation = value;
                    RaisePropertyChanged("LastSampleInterpretation");
                }
            }
        }
        public string LastSamplePCRResult
        {
            get { return Case.LastSamplePCRResult; }
            set
            {
                if (Case.LastSamplePCRResult != value)
                {
                    Case.LastSamplePCRResult = value;
                    RaisePropertyChanged("LastSamplePCRResult");
                }
            }
        }
        public string CurrentHospital
        {
            get { return Case.CurrentHospital; }
            set
            {
                if (Case.CurrentHospital != value)
                {
                    Case.CurrentHospital = value;
                    RaisePropertyChanged("CurrentHospital");
                }
            }
        }
        public string GenderAbbreviation
        {
            get
            {
                if (this.Gender.Equals(CaseViewModel.Female)) { return CaseViewModel.FemaleAbbr; }
                else if (this.Gender.Equals(CaseViewModel.Male)) { return CaseViewModel.MaleAbbr; }
                else return String.Empty;
            }
        }

        public int? EpiWeekOnset
        {
            get
            {
                if (DateOnset.HasValue)
                {
                    DateTime MMWR__Start;
                    MMWR__Start = Core.Common.GetMMWRStart(DateOnset.Value, 1);

                    TimeSpan MMWR__DayCount = DateOnset.Value.Subtract(MMWR__Start);
                    int MMWR__Week = ((int)(MMWR__DayCount.Days / 7)) + 1;

                    return MMWR__Week;
                }
                else
                {
                    return null;
                }
            }
        }

        public DateTime? EpiCurveDisplayDate
        {
            get
            {
                if (DateOnset.HasValue)
                {
                    DateTime MMWR__Start;
                    MMWR__Start = Core.Common.GetMMWRStart(DateOnset.Value, 1);

                    TimeSpan MMWR__DayCount = DateOnset.Value.Subtract(MMWR__Start);
                    int MMWR__Week = ((int)(MMWR__DayCount.Days / 7)) + 1;

                    return MMWR__Start.AddDays((MMWR__Week * 7) - 1);
                }
                else
                {
                    return null;
                }
            }
        }
        public DateTime? EpiCurveDeathDisplayDate
        {
            get
            {
                if (DateDeathCurrentOrFinal.HasValue)
                {
                    DateTime MMWR__Start;
                    MMWR__Start = Core.Common.GetMMWRStart(DateDeathCurrentOrFinal.Value, 1);

                    TimeSpan MMWR__DayCount = DateDeathCurrentOrFinal.Value.Subtract(MMWR__Start);
                    int MMWR__Week = ((int)(MMWR__DayCount.Days / 7)) + 1;

                    return MMWR__Start.AddDays((MMWR__Week * 7) - 1);
                }
                else
                {
                    return null;
                }
            }
        }
        public string EpiCurveCaseCategory
        {
            get
            {
                if (EpiCaseDef == CaseViewModel.Confirmed)
                {
                    //if (FinalLabClass == "Confirmed Acute" || FinalLabClass == "Confirmed Convalescent")
                    //{
                    //    return FinalLabClass;
                    //}
                    return EpiCaseDef;
                }
                else if (EpiCaseDef == CaseViewModel.Probable)
                {
                    return EpiCaseDef;
                }
                else if (EpiCaseDef == CaseViewModel.Suspect)
                {
                    return EpiCaseDef;
                }

                return String.Empty;
            }
        }

        public DateTime? DateDeathCurrentOrFinal { get { return Case.DateDeathCurrentOrFinal; } }

        public DateTime? DateOutcomeInfoCompleted { get { return Case.DateOutcomeInfoCompleted; } set { if (Case.DateOutcomeInfoCompleted != value) { Case.DateOutcomeInfoCompleted = value; RaisePropertyChanged("DateOutcomeInfoCompleted"); } } }
        public string BleedUnexplainedEver { get { return Case.BleedUnexplainedEver; } set { if (Case.BleedUnexplainedEver != value) { Case.BleedUnexplainedEver = value; RaisePropertyChanged("BleedUnexplainedEver"); } } }
        public string SpecifyBleeding { get { return Case.SpecifyBleeding; } set { if (Case.SpecifyBleeding != value) { Case.SpecifyBleeding = value; RaisePropertyChanged("SpecifyBleeding"); } } }
        public string HospitalDischarge { get { return Case.HospitalDischarge; } set { if (Case.HospitalDischarge != value) { Case.HospitalDischarge = value; RaisePropertyChanged("HospitalDischarge"); } } }
        public string HospitalDischargeDistrict { get { return Case.HospitalDischargeDistrict; } set { if (Case.HospitalDischargeDistrict != value) { Case.HospitalDischargeDistrict = value; RaisePropertyChanged("HospitalDischargeDistrict"); } } }
        public bool DateDischargeIsoEst { get { return Case.DateDischargeIsoEst; } set { if (Case.DateDischargeIsoEst != value) { Case.DateDischargeIsoEst = value; RaisePropertyChanged("DateDischargeIsoEst"); } } }
        public DateTime? DateDischargeHospital { get { return Case.DateDischargeHospital; } set { if (Case.DateDischargeHospital != value) { Case.DateDischargeHospital = value; RaisePropertyChanged("DateDischargeHospital"); } } }
        public bool DateDischargeHospitalEst { get { return Case.DateDischargeHospitalEst; } set { if (Case.DateDischargeHospitalEst != value) { Case.DateDischargeHospitalEst = value; RaisePropertyChanged("DateDischargeHospitalEst"); } } }
        public DateTime? DateDeath2 { get { return Case.DateDeath2; } set { if (Case.DateDeath2 != value) { Case.DateDeath2 = value; RaisePropertyChanged("DateDeath2"); } } }
        public bool DateDeath2Est { get { return Case.DateDeath2Est; } set { if (Case.DateDeath2Est != value) { Case.DateDeath2Est = value; RaisePropertyChanged("DateDeath2Est"); } } }
        public string DateDeath2EstSpecify { get { return Case.DateDeath2EstSpecify; } set { if (Case.DateDeath2EstSpecify != value) { Case.DateDeath2EstSpecify = value; RaisePropertyChanged("DateDeath2EstSpecify"); } } }
        public string PlaceDeath { get { return Case.PlaceDeath; } set { if (Case.PlaceDeath != value) { Case.PlaceDeath = value; RaisePropertyChanged("PlaceDeath"); } } }
        public string HospitalDeath { get { return Case.HospitalDeath; } set { if (Case.HospitalDeath != value) { Case.HospitalDeath = value; RaisePropertyChanged("HospitalDeath"); } } }
        public string PlaceDeathOther { get { return Case.PlaceDeathOther; } set { if (Case.PlaceDeathOther != value) { Case.PlaceDeathOther = value; RaisePropertyChanged("PlaceDeathOther"); } } }
        public string VillageDeath { get { return Case.VillageDeath; } set { if (Case.VillageDeath != value) { Case.VillageDeath = value; RaisePropertyChanged("VillageDeath"); } } }
        public string SubCountyDeath { get { return Case.SubCountyDeath; } set { if (Case.SubCountyDeath != value) { Case.SubCountyDeath = value; RaisePropertyChanged("SubCountyDeath"); } } }
        public string DistrictDeath { get { return Case.DistrictDeath; } set { if (Case.DistrictDeath != value) { Case.DistrictDeath = value; RaisePropertyChanged("DistrictDeath"); } } }
        public DateTime? DateFuneral { get { return Case.DateFuneral; } set { if (Case.DateFuneral != value) { Case.DateFuneral = value; RaisePropertyChanged("DateFuneral"); } } }
        public bool FuneralConductedFam { get { return Case.FuneralConductedFam; } set { if (Case.FuneralConductedFam != value) { Case.FuneralConductedFam = value; RaisePropertyChanged("FuneralConductedFam"); } } }
        public bool FuneralConductedOutbreakTeam { get { return Case.FuneralConductedOutbreakTeam; } set { if (Case.FuneralConductedOutbreakTeam != value) { Case.FuneralConductedOutbreakTeam = value; RaisePropertyChanged("FuneralConductedOutbreakTeam"); } } }
        public string VillageFuneral { get { return Case.VillageFuneral; } set { if (Case.VillageFuneral != value) { Case.VillageFuneral = value; RaisePropertyChanged("VillageFuneral"); } } }
        public string SubCountyFuneral { get { return Case.SubCountyFuneral; } set { if (Case.SubCountyFuneral != value) { Case.SubCountyFuneral = value; RaisePropertyChanged("SubCountyFuneral"); } } }
        public string DistrictFuneral { get { return Case.DistrictFuneral; } set { if (Case.DistrictFuneral != value) { Case.DistrictFuneral = value; RaisePropertyChanged("DistrictFuneral"); } } }

        public string OriginalID { get { return Case.OriginalID; } set { if (Case.OriginalID != value) { Case.OriginalID = value; RaisePropertyChanged("OriginalID"); } } }
        public string PhoneNumber { get { return Case.PhoneNumber; } set { if (Case.PhoneNumber != value) { Case.PhoneNumber = value; RaisePropertyChanged("PhoneNumber"); } } }
        public string PhoneOwner { get { return Case.PhoneOwner; } set { if (Case.PhoneOwner != value) { Case.PhoneOwner = value; RaisePropertyChanged("PhoneOwner"); } } }
        public string StatusReport { get { return Case.StatusReport; } set { if (Case.StatusReport != value) { Case.StatusReport = value; RaisePropertyChanged("StatusReport"); } } }
        public bool OccupationFarmer { get { return Case.OccupationFarmer; } set { if (Case.OccupationFarmer != value) { Case.OccupationFarmer = value; RaisePropertyChanged("OccupationFarmer"); } } }
        public bool OccupationButcher { get { return Case.OccupationButcher; } set { if (Case.OccupationButcher != value) { Case.OccupationButcher = value; RaisePropertyChanged("OccupationButcher"); } } }
        public bool OccupationHunter { get { return Case.OccupationHunter; } set { if (Case.OccupationHunter != value) { Case.OccupationHunter = value; RaisePropertyChanged("OccupationHunter"); } } }
        public bool OccupationMiner { get { return Case.OccupationMiner; } set { if (Case.OccupationMiner != value) { Case.OccupationMiner = value; RaisePropertyChanged("OccupationMiner"); } } }
        public bool OccupationReligious { get { return Case.OccupationReligious; } set { if (Case.OccupationReligious != value) { Case.OccupationReligious = value; RaisePropertyChanged("OccupationReligious"); } } }
        public bool OccupationHousewife { get { return Case.OccupationHousewife; } set { if (Case.OccupationHousewife != value) { Case.OccupationHousewife = value; RaisePropertyChanged("OccupationHousewife"); } } }
        public bool OccupationStudent { get { return Case.OccupationStudent; } set { if (Case.OccupationStudent != value) { Case.OccupationStudent = value; RaisePropertyChanged("OccupationStudent"); } } }
        public bool OccupationChild { get { return Case.OccupationChild; } set { if (Case.OccupationChild != value) { Case.OccupationChild = value; RaisePropertyChanged("OccupationChild"); } } }
        public bool OccupationBusinessman { get { return Case.OccupationBusinessman; } set { if (Case.OccupationBusinessman != value) { Case.OccupationBusinessman = value; RaisePropertyChanged("OccupationBusinessman"); } } }
        public bool OccupationTransporter { get { return Case.OccupationTransporter; } set { if (Case.OccupationTransporter != value) { Case.OccupationTransporter = value; RaisePropertyChanged("OccupationTransporter"); } } }
        //public bool OccupationHCW { get { return Case.REPLACEME; } set { if (Case.REPLACEME != value) { Case.REPLACEME = value; RaisePropertyChanged("REPLACEME"); } } }
        public bool OccupationTraditionalHealer { get { return Case.OccupationTraditionalHealer; } set { if (Case.OccupationTraditionalHealer != value) { Case.OccupationTraditionalHealer = value; RaisePropertyChanged("OccupationTraditionalHealer"); } } }
        public bool OccupationOther { get { return Case.OccupationOther; } set { if (Case.OccupationOther != value) { Case.OccupationOther = value; RaisePropertyChanged("OccupationOther"); } } }

        public string OccupationTransporterSpecify { get { return Case.OccupationTransporterSpecify; } set { if (Case.OccupationTransporterSpecify != value) { Case.OccupationTransporterSpecify = value; RaisePropertyChanged("OccupationTransporterSpecify"); } } }
        public string OccupationBusinessSpecify { get { return Case.OccupationBusinessSpecify; } set { if (Case.OccupationBusinessSpecify != value) { Case.OccupationBusinessSpecify = value; RaisePropertyChanged("OccupationBusinessSpecify"); } } }
        public string OccupationOtherSpecify { get { return Case.OccupationOtherSpecify; } set { if (Case.OccupationOtherSpecify != value) { Case.OccupationOtherSpecify = value; RaisePropertyChanged("OccupationOtherSpecify"); } } }
        public string OccupationHCWPosition { get { return Case.OccupationHCWPosition; } set { if (Case.OccupationHCWPosition != value) { Case.OccupationHCWPosition = value; RaisePropertyChanged("OccupationHCWPosition"); } } }
        public string OccupationHCWFacility { get { return Case.OccupationHCWFacility; } set { if (Case.OccupationHCWFacility != value) { Case.OccupationHCWFacility = value; RaisePropertyChanged("OccupationHCWFacility"); } } }

        public double? Latitude { get { return Case.Latitude; } set { if (Case.Latitude != value) { Case.Latitude = value; RaisePropertyChanged("Latitude"); } } }
        public double? Longitude { get { return Case.Longitude; } set { if (Case.Longitude != value) { Case.Longitude = value; RaisePropertyChanged("Longitude"); } } }

        public DateTime? DateOnsetLocalStart { get { return Case.DateOnsetLocalStart; } set { if (Case.DateOnsetLocalStart != value) { Case.DateOnsetLocalStart = value; RaisePropertyChanged("DateOnsetLocalStart"); } } }
        public DateTime? DateOnsetLocalEnd { get { return Case.DateOnsetLocalEnd; } set { if (Case.DateOnsetLocalEnd != value) { Case.DateOnsetLocalEnd = value; RaisePropertyChanged("DateOnsetLocalEnd"); } } }

        public string HospitalizedCurrent { get { return Case.HospitalizedCurrent; } set { if (Case.HospitalizedCurrent != value) { Case.HospitalizedCurrent = value; RaisePropertyChanged("HospitalizedCurrent"); } } }
        public string HospitalizedPast { get { return Case.HospitalizedPast; } set { if (Case.HospitalizedPast != value) { Case.HospitalizedPast = value; RaisePropertyChanged("HospitalizedPast"); } } }

        public DateTime? DateHospitalPastStart1 { get { return Case.DateHospitalPastStart1; } set { if (Case.DateHospitalPastStart1 != value) { Case.DateHospitalPastStart1 = value; RaisePropertyChanged("DateHospitalPastStart1"); } } }
        public DateTime? DateHospitalPastStart2 { get { return Case.DateHospitalPastStart2; } set { if (Case.DateHospitalPastStart2 != value) { Case.DateHospitalPastStart2 = value; RaisePropertyChanged("DateHospitalPastStart2"); } } }

        public DateTime? DateHospitalPastEnd1 { get { return Case.DateHospitalPastEnd1; } set { if (Case.DateHospitalPastEnd1 != value) { Case.DateHospitalPastEnd1 = value; RaisePropertyChanged("DateHospitalPastEnd1"); } } }
        public DateTime? DateHospitalPastEnd2 { get { return Case.DateHospitalPastEnd2; } set { if (Case.DateHospitalPastEnd2 != value) { Case.DateHospitalPastEnd2 = value; RaisePropertyChanged("DateHospitalPastEnd2"); } } }

        public string HospitalPast1 { get { return Case.HospitalPast1; } set { if (Case.HospitalPast1 != value) { Case.HospitalPast1 = value; RaisePropertyChanged("HospitalPast1"); } } }
        public string HospitalPast2 { get { return Case.HospitalPast2; } set { if (Case.HospitalPast2 != value) { Case.HospitalPast2 = value; RaisePropertyChanged("HospitalPast2"); } } }

        public string HospitalVillage1 { get { return Case.HospitalVillage1; } set { if (Case.HospitalVillage1 != value) { Case.HospitalVillage1 = value; RaisePropertyChanged("HospitalVillage1"); } } }
        public string HospitalVillage2 { get { return Case.HospitalVillage2; } set { if (Case.HospitalVillage2 != value) { Case.HospitalVillage2 = value; RaisePropertyChanged("HospitalVillage2"); } } }

        public string HospitalDistrict1 { get { return Case.HospitalDistrict1; } set { if (Case.HospitalDistrict1 != value) { Case.HospitalDistrict1 = value; RaisePropertyChanged("HospitalDistrict1"); } } }
        public string HospitalDistrict2 { get { return Case.HospitalDistrict2; } set { if (Case.HospitalDistrict2 != value) { Case.HospitalDistrict2 = value; RaisePropertyChanged("HospitalDistrict2"); } } }

        public string IsolationPast1 { get { return Case.IsolationPast1; } set { if (Case.IsolationPast1 != value) { Case.IsolationPast1 = value; RaisePropertyChanged("IsolationPast1"); } } }
        public string IsolationPast2 { get { return Case.IsolationPast2; } set { if (Case.IsolationPast2 != value) { Case.IsolationPast2 = value; RaisePropertyChanged("IsolationPast2"); } } }

        public string SymptomFeverFinal { get { return Case.SymptomFeverFinal; } set { if (Case.SymptomFeverFinal != value) { Case.SymptomFeverFinal = value; RaisePropertyChanged("SymptomFeverFinal"); } } }
        public double? SymptomFeverTempFinal { get { return Case.SymptomFeverTempFinal; } set { if (Case.SymptomFeverTempFinal != value) { Case.SymptomFeverTempFinal = value; RaisePropertyChanged("SymptomFeverTempFinal"); } } }
        public string SymptomFeverTempSourceFinal { get { return Case.SymptomFeverTempSourceFinal; } set { if (Case.SymptomFeverTempSourceFinal != value) { Case.SymptomFeverTempSourceFinal = value; RaisePropertyChanged("SymptomFeverTempSourceFinal"); } } }
        public string SymptomVomitingFinal { get { return Case.SymptomVomitingFinal; } set { if (Case.SymptomVomitingFinal != value) { Case.SymptomVomitingFinal = value; RaisePropertyChanged("SymptomVomitingFinal"); } } }
        public string SymptomDiarrheaFinal { get { return Case.SymptomDiarrheaFinal; } set { if (Case.SymptomDiarrheaFinal != value) { Case.SymptomDiarrheaFinal = value; RaisePropertyChanged("SymptomDiarrheaFinal"); } } }
        public string SymptomFatigueFinal { get { return Case.SymptomFatigueFinal; } set { if (Case.SymptomFatigueFinal != value) { Case.SymptomFatigueFinal = value; RaisePropertyChanged("SymptomFatigueFinal"); } } }
        public string SymptomAnorexiaFinal { get { return Case.SymptomAnorexiaFinal; } set { if (Case.SymptomAnorexiaFinal != value) { Case.SymptomAnorexiaFinal = value; RaisePropertyChanged("SymptomAnorexiaFinal"); } } }
        public string SymptomAbdPainFinal { get { return Case.SymptomAbdPainFinal; } set { if (Case.SymptomAbdPainFinal != value) { Case.SymptomAbdPainFinal = value; RaisePropertyChanged("SymptomAbdPainFinal"); } } }
        public string SymptomChestPainFinal { get { return Case.SymptomChestPainFinal; } set { if (Case.SymptomChestPainFinal != value) { Case.SymptomChestPainFinal = value; RaisePropertyChanged("SymptomChestPainFinal"); } } }
        public string SymptomMusclePainFinal { get { return Case.SymptomMusclePainFinal; } set { if (Case.SymptomMusclePainFinal != value) { Case.SymptomMusclePainFinal = value; RaisePropertyChanged("SymptomMusclePainFinal"); } } }
        public string SymptomJointPainFinal { get { return Case.SymptomJointPainFinal; } set { if (Case.SymptomJointPainFinal != value) { Case.SymptomJointPainFinal = value; RaisePropertyChanged("SymptomJointPainFinal"); } } }
        public string SymptomHeadacheFinal { get { return Case.SymptomHeadacheFinal; } set { if (Case.SymptomHeadacheFinal != value) { Case.SymptomHeadacheFinal = value; RaisePropertyChanged("SymptomHeadacheFinal"); } } }
        public string SymptomCoughFinal { get { return Case.SymptomCoughFinal; } set { if (Case.SymptomCoughFinal != value) { Case.SymptomCoughFinal = value; RaisePropertyChanged("SymptomCoughFinal"); } } }
        public string SymptomDiffBreatheFinal { get { return Case.SymptomDiffBreatheFinal; } set { if (Case.SymptomDiffBreatheFinal != value) { Case.SymptomDiffBreatheFinal = value; RaisePropertyChanged("SymptomDiffBreatheFinal"); } } }
        public string SymptomDiffSwallowFinal { get { return Case.SymptomDiffSwallowFinal; } set { if (Case.SymptomDiffSwallowFinal != value) { Case.SymptomDiffSwallowFinal = value; RaisePropertyChanged("SymptomDiffSwallowFinal"); } } }
        public string SymptomSoreThroatFinal { get { return Case.SymptomSoreThroatFinal; } set { if (Case.SymptomSoreThroatFinal != value) { Case.SymptomSoreThroatFinal = value; RaisePropertyChanged("SymptomSoreThroatFinal"); } } }
        public string SymptomJaundiceFinal { get { return Case.SymptomJaundiceFinal; } set { if (Case.SymptomJaundiceFinal != value) { Case.SymptomJaundiceFinal = value; RaisePropertyChanged("SymptomJaundiceFinal"); } } }
        public string SymptomConjunctivitisFinal { get { return Case.SymptomConjunctivitisFinal; } set { if (Case.SymptomConjunctivitisFinal != value) { Case.SymptomConjunctivitisFinal = value; RaisePropertyChanged("SymptomConjunctivitisFinal"); } } }
        public string SymptomRashFinal { get { return Case.SymptomRashFinal; } set { if (Case.SymptomRashFinal != value) { Case.SymptomRashFinal = value; RaisePropertyChanged("SymptomRashFinal"); } } }
        public string SymptomHiccupsFinal { get { return Case.SymptomHiccupsFinal; } set { if (Case.SymptomHiccupsFinal != value) { Case.SymptomHiccupsFinal = value; RaisePropertyChanged("SymptomHiccupsFinal"); } } }
        public string SymptomPainEyesFinal { get { return Case.SymptomPainEyesFinal; } set { if (Case.SymptomPainEyesFinal != value) { Case.SymptomPainEyesFinal = value; RaisePropertyChanged("SymptomPainEyesFinal"); } } }
        public string SymptomUnconsciousFinal { get { return Case.SymptomUnconsciousFinal; } set { if (Case.SymptomUnconsciousFinal != value) { Case.SymptomUnconsciousFinal = value; RaisePropertyChanged("SymptomUnconsciousFinal"); } } }
        public string SymptomConfusedFinal { get { return Case.SymptomConfusedFinal; } set { if (Case.SymptomConfusedFinal != value) { Case.SymptomConfusedFinal = value; RaisePropertyChanged("SymptomConfusedFinal"); } } }
        public string SymptomOtherHemoFinal { get { return Case.SymptomOtherHemoFinal; } set { if (Case.SymptomOtherHemoFinal != value) { Case.SymptomOtherHemoFinal = value; RaisePropertyChanged("SymptomOtherHemoFinal"); } } }
        public string SymptomOtherHemoFinalSpecify { get { return Case.SymptomOtherHemoFinalSpecify; } set { if (Case.SymptomOtherHemoFinalSpecify != value) { Case.SymptomOtherHemoFinalSpecify = value; RaisePropertyChanged("SymptomOtherHemoFinalSpecify"); } } }

        public string SymptomBleedUnexplained { get { return Case.SymptomBleedUnexplained; } set { if (Case.SymptomBleedUnexplained != value) { Case.SymptomBleedUnexplained = value; RaisePropertyChanged("SymptomBleedUnexplained"); } } }
        public string SymptomBleedGums { get { return Case.SymptomBleedGums; } set { if (Case.SymptomBleedGums != value) { Case.SymptomBleedGums = value; RaisePropertyChanged("SymptomBleedGums"); } } }
        public string SymptomBleedInjectionSite { get { return Case.SymptomBleedInjectionSite; } set { if (Case.SymptomBleedInjectionSite != value) { Case.SymptomBleedInjectionSite = value; RaisePropertyChanged("SymptomBleedInjectionSite"); } } }
        public string SymptomNoseBleed { get { return Case.SymptomNoseBleed; } set { if (Case.SymptomNoseBleed != value) { Case.SymptomNoseBleed = value; RaisePropertyChanged("SymptomNoseBleed"); } } }
        public string SymptomBloodyStool { get { return Case.SymptomBloodyStool; } set { if (Case.SymptomBloodyStool != value) { Case.SymptomBloodyStool = value; RaisePropertyChanged("SymptomBloodyStool"); } } }
        public string SymptomBloodVomit { get { return Case.SymptomBloodVomit; } set { if (Case.SymptomBloodVomit != value) { Case.SymptomBloodVomit = value; RaisePropertyChanged("SymptomBloodVomit"); } } }
        public string SymptomDigestedBlood { get { return Case.SymptomDigestedBlood; } set { if (Case.SymptomDigestedBlood != value) { Case.SymptomDigestedBlood = value; RaisePropertyChanged("SymptomDigestedBlood"); } } }
        public string SymptomCoughBlood { get { return Case.SymptomCoughBlood; } set { if (Case.SymptomCoughBlood != value) { Case.SymptomCoughBlood = value; RaisePropertyChanged("SymptomCoughBlood"); } } }
        public string SymptomBleedVagina { get { return Case.SymptomBleedVagina; } set { if (Case.SymptomBleedVagina != value) { Case.SymptomBleedVagina = value; RaisePropertyChanged("SymptomBleedVagina"); } } }
        public string SymptomBruising { get { return Case.SymptomBruising; } set { if (Case.SymptomBruising != value) { Case.SymptomBruising = value; RaisePropertyChanged("SymptomBruising"); } } }
        public string SymptomBloodInUrine { get { return Case.SymptomBloodInUrine; } set { if (Case.SymptomBloodInUrine != value) { Case.SymptomBloodInUrine = value; RaisePropertyChanged("SymptomBloodInUrine"); } } }
        public string SymptomOtherNonHemorrhagic { get { return Case.SymptomOtherNonHemorrhagic; } set { if (Case.SymptomOtherNonHemorrhagic != value) { Case.SymptomOtherNonHemorrhagic = value; RaisePropertyChanged("SymptomOtherNonHemorrhagic"); } } }

        public string SymptomFever { get { return Case.SymptomFever; } set { if (Case.SymptomFever != value) { Case.SymptomFever = value; RaisePropertyChanged("SymptomFever"); } } }
        public double? SymptomFeverTemp { get { return Case.SymptomFeverTemp; } set { if (Case.SymptomFeverTemp != value) { Case.SymptomFeverTemp = value; RaisePropertyChanged("SymptomFeverTemp"); } } }
        public string SymptomFeverTempSource { get { return Case.SymptomFeverTempSource; } set { if (Case.SymptomFeverTempSource != value) { Case.SymptomFeverTempSource = value; RaisePropertyChanged("SymptomFeverTempSource"); } } }
        public string SymptomVomiting { get { return Case.SymptomVomiting; } set { if (Case.SymptomVomiting != value) { Case.SymptomVomiting = value; RaisePropertyChanged("SymptomVomiting"); } } }
        public string SymptomDiarrhea { get { return Case.SymptomDiarrhea; } set { if (Case.SymptomDiarrhea != value) { Case.SymptomDiarrhea = value; RaisePropertyChanged("SymptomDiarrhea"); } } }
        public string SymptomFatigue { get { return Case.SymptomFatigue; } set { if (Case.SymptomFatigue != value) { Case.SymptomFatigue = value; RaisePropertyChanged("SymptomFatigue"); } } }
        public string SymptomAnorexia { get { return Case.SymptomAnorexia; } set { if (Case.SymptomAnorexia != value) { Case.SymptomAnorexia = value; RaisePropertyChanged("SymptomAnorexia"); } } }
        public string SymptomAbdPain { get { return Case.SymptomAbdPain; } set { if (Case.SymptomAbdPain != value) { Case.SymptomAbdPain = value; RaisePropertyChanged("SymptomAbdPain"); } } }
        public string SymptomChestPain { get { return Case.SymptomChestPain; } set { if (Case.SymptomChestPain != value) { Case.SymptomChestPain = value; RaisePropertyChanged("SymptomChestPain"); } } }
        public string SymptomMusclePain { get { return Case.SymptomMusclePain; } set { if (Case.SymptomMusclePain != value) { Case.SymptomMusclePain = value; RaisePropertyChanged("SymptomMusclePain"); } } }
        public string SymptomJointPain { get { return Case.SymptomJointPain; } set { if (Case.SymptomJointPain != value) { Case.SymptomJointPain = value; RaisePropertyChanged("SymptomJointPain"); } } }
        public string SymptomHeadache { get { return Case.SymptomHeadache; } set { if (Case.SymptomHeadache != value) { Case.SymptomHeadache = value; RaisePropertyChanged("SymptomHeadache"); } } }
        public string SymptomCough { get { return Case.SymptomCough; } set { if (Case.SymptomCough != value) { Case.SymptomCough = value; RaisePropertyChanged("SymptomCough"); } } }
        public string SymptomDiffBreathe { get { return Case.SymptomDiffBreathe; } set { if (Case.SymptomDiffBreathe != value) { Case.SymptomDiffBreathe = value; RaisePropertyChanged("SymptomDiffBreathe"); } } }
        public string SymptomDiffSwallow { get { return Case.SymptomDiffSwallow; } set { if (Case.SymptomDiffSwallow != value) { Case.SymptomDiffSwallow = value; RaisePropertyChanged("SymptomDiffSwallow"); } } }
        public string SymptomSoreThroat { get { return Case.SymptomSoreThroat; } set { if (Case.SymptomSoreThroat != value) { Case.SymptomSoreThroat = value; RaisePropertyChanged("SymptomSoreThroat"); } } }
        public string SymptomJaundice { get { return Case.SymptomJaundice; } set { if (Case.SymptomJaundice != value) { Case.SymptomJaundice = value; RaisePropertyChanged("SymptomJaundice"); } } }
        public string SymptomConjunctivitis { get { return Case.SymptomConjunctivitis; } set { if (Case.SymptomConjunctivitis != value) { Case.SymptomConjunctivitis = value; RaisePropertyChanged("SymptomConjunctivitis"); } } }
        public string SymptomRash { get { return Case.SymptomRash; } set { if (Case.SymptomRash != value) { Case.SymptomRash = value; RaisePropertyChanged("SymptomRash"); } } }
        public string SymptomHiccups { get { return Case.SymptomHiccups; } set { if (Case.SymptomHiccups != value) { Case.SymptomHiccups = value; RaisePropertyChanged("SymptomHiccups"); } } }
        public string SymptomPainEyes { get { return Case.SymptomPainEyes; } set { if (Case.SymptomPainEyes != value) { Case.SymptomPainEyes = value; RaisePropertyChanged("SymptomPainEyes"); } } }
        public string SymptomUnconscious { get { return Case.SymptomUnconscious; } set { if (Case.SymptomUnconscious != value) { Case.SymptomUnconscious = value; RaisePropertyChanged("SymptomUnconscious"); } } }
        public string SymptomConfused { get { return Case.SymptomConfused; } set { if (Case.SymptomConfused != value) { Case.SymptomConfused = value; RaisePropertyChanged("SymptomConfused"); } } }
        public string SymptomOtherHemo { get { return Case.SymptomOtherHemo; } set { if (Case.SymptomOtherHemo != value) { Case.SymptomOtherHemo = value; RaisePropertyChanged("SymptomOtherHemo"); } } }
        public string SymptomOtherHemoSpecify { get { return Case.SymptomOtherHemoSpecify; } set { if (Case.SymptomOtherHemoSpecify != value) { Case.SymptomOtherHemoSpecify = value; RaisePropertyChanged("SymptomOtherHemoSpecify"); } } }
        public string SymptomOtherNonHemorrhagicSpecify { get { return Case.SymptomOtherNonHemorrhagicSpecify; } set { if (Case.SymptomOtherNonHemorrhagicSpecify != value) { Case.SymptomOtherNonHemorrhagicSpecify = value; RaisePropertyChanged("SymptomOtherNonHemorrhagicSpecify"); } } }

        public string HadContact { get { return Case.HadContact; } set { if (Case.HadContact != value) { Case.HadContact = value; RaisePropertyChanged("HadContact"); } } }
        public string ContactName1 { get { return Case.ContactName1; } set { if (Case.ContactName1 != value) { Case.ContactName1 = value; RaisePropertyChanged("ContactName1"); } } }
        public string ContactName2 { get { return Case.ContactName2; } set { if (Case.ContactName2 != value) { Case.ContactName2 = value; RaisePropertyChanged("ContactName2"); } } }
        public string ContactName3 { get { return Case.ContactName3; } set { if (Case.ContactName3 != value) { Case.ContactName3 = value; RaisePropertyChanged("ContactName3"); } } }
        public string ContactRelation1 { get { return Case.ContactRelation1; } set { if (Case.ContactRelation1 != value) { Case.ContactRelation1 = value; RaisePropertyChanged("ContactRelation1"); } } }
        public string ContactRelation2 { get { return Case.ContactRelation2; } set { if (Case.ContactRelation2 != value) { Case.ContactRelation2 = value; RaisePropertyChanged("ContactRelation2"); } } }
        public string ContactRelation3 { get { return Case.ContactRelation3; } set { if (Case.ContactRelation3 != value) { Case.ContactRelation3 = value; RaisePropertyChanged("ContactRelation3"); } } }
        public DateTime? ContactStartDate1 { get { return Case.ContactStartDate1; } set { if (Case.ContactStartDate1 != value) { Case.ContactStartDate1 = value; RaisePropertyChanged("ContactStartDate1"); } } }
        public DateTime? ContactStartDate2 { get { return Case.ContactStartDate2; } set { if (Case.ContactStartDate2 != value) { Case.ContactStartDate2 = value; RaisePropertyChanged("ContactStartDate2"); } } }
        public DateTime? ContactStartDate3 { get { return Case.ContactStartDate3; } set { if (Case.ContactStartDate3 != value) { Case.ContactStartDate3 = value; RaisePropertyChanged("ContactStartDate3"); } } }
        public DateTime? ContactEndDate1 { get { return Case.ContactEndDate1; } set { if (Case.ContactEndDate1 != value) { Case.ContactEndDate1 = value; RaisePropertyChanged("ContactEndDate1"); } } }
        public DateTime? ContactEndDate2 { get { return Case.ContactEndDate2; } set { if (Case.ContactEndDate2 != value) { Case.ContactEndDate2 = value; RaisePropertyChanged("ContactEndDate2"); } } }
        public DateTime? ContactEndDate3 { get { return Case.ContactEndDate3; } set { if (Case.ContactEndDate3 != value) { Case.ContactEndDate3 = value; RaisePropertyChanged("ContactEndDate3"); } } }
        public bool ContactDate1Estimated { get { return Case.ContactDate1Estimated; } set { if (Case.ContactDate1Estimated != value) { Case.ContactDate1Estimated = value; RaisePropertyChanged("ContactDate1Estimated"); } } }
        public bool ContactDate2Estimated { get { return Case.ContactDate2Estimated; } set { if (Case.ContactDate2Estimated != value) { Case.ContactDate2Estimated = value; RaisePropertyChanged("ContactDate2Estimated"); } } }
        public bool ContactDate3Estimated { get { return Case.ContactDate3Estimated; } set { if (Case.ContactDate3Estimated != value) { Case.ContactDate3Estimated = value; RaisePropertyChanged("ContactDate3Estimated"); } } }
        public string ContactVillage1 { get { return Case.ContactVillage1; } set { if (Case.ContactVillage1 != value) { Case.ContactVillage1 = value; RaisePropertyChanged("ContactVillage1"); } } }
        public string ContactVillage2 { get { return Case.ContactVillage2; } set { if (Case.ContactVillage2 != value) { Case.ContactVillage2 = value; RaisePropertyChanged("ContactVillage2"); } } }
        public string ContactVillage3 { get { return Case.ContactVillage3; } set { if (Case.ContactVillage3 != value) { Case.ContactVillage3 = value; RaisePropertyChanged("ContactVillage3"); } } }
        public string ContactDistrict1 { get { return Case.ContactDistrict1; } set { if (Case.ContactDistrict1 != value) { Case.ContactDistrict1 = value; RaisePropertyChanged("ContactDistrict1"); } } }
        public string ContactDistrict2 { get { return Case.ContactDistrict2; } set { if (Case.ContactDistrict2 != value) { Case.ContactDistrict2 = value; RaisePropertyChanged("ContactDistrict2"); } } }
        public string ContactDistrict3 { get { return Case.ContactDistrict3; } set { if (Case.ContactDistrict3 != value) { Case.ContactDistrict3 = value; RaisePropertyChanged("ContactDistrict3"); } } }
        public string ContactCountry1 { get { return Case.ContactCountry1; } set { if (Case.ContactCountry1 != value) { Case.ContactCountry1 = value; RaisePropertyChanged("ContactCountry1"); } } }
        public string ContactCountry2 { get { return Case.ContactCountry2; } set { if (Case.ContactCountry2 != value) { Case.ContactCountry2 = value; RaisePropertyChanged("ContactCountry2"); } } }
        public string ContactCountry3 { get { return Case.ContactCountry3; } set { if (Case.ContactCountry3 != value) { Case.ContactCountry3 = value; RaisePropertyChanged("ContactCountry3"); } } }
        public string TypesOfContact1 { get { return Case.TypesOfContact1; } set { if (Case.TypesOfContact1 != value) { Case.TypesOfContact1 = value; RaisePropertyChanged("TypesOfContact1"); } } }
        public string TypesOfContact2 { get { return Case.TypesOfContact2; } set { if (Case.TypesOfContact2 != value) { Case.TypesOfContact2 = value; RaisePropertyChanged("TypesOfContact2"); } } }
        public string TypesOfContact3 { get { return Case.TypesOfContact3; } set { if (Case.TypesOfContact3 != value) { Case.TypesOfContact3 = value; RaisePropertyChanged("TypesOfContact3"); } } }
        public string ContactStatus1 { get { return Case.ContactStatus1; } set { if (Case.ContactStatus1 != value) { Case.ContactStatus1 = value; RaisePropertyChanged("ContactStatus1"); } } }
        public string ContactStatus2 { get { return Case.ContactStatus2; } set { if (Case.ContactStatus2 != value) { Case.ContactStatus2 = value; RaisePropertyChanged("ContactStatus2"); } } }
        public string ContactStatus3 { get { return Case.ContactStatus3; } set { if (Case.ContactStatus3 != value) { Case.ContactStatus3 = value; RaisePropertyChanged("ContactStatus3"); } } }
        public DateTime? ContactDeathDate1 { get { return Case.ContactDeathDate1; } set { if (Case.ContactDeathDate1 != value) { Case.ContactDeathDate1 = value; RaisePropertyChanged("ContactDeathDate1"); } } }
        public DateTime? ContactDeathDate2 { get { return Case.ContactDeathDate2; } set { if (Case.ContactDeathDate2 != value) { Case.ContactDeathDate2 = value; RaisePropertyChanged("ContactDeathDate2"); } } }
        public DateTime? ContactDeathDate3 { get { return Case.ContactDeathDate3; } set { if (Case.ContactDeathDate3 != value) { Case.ContactDeathDate3 = value; RaisePropertyChanged("ContactDeathDate3"); } } }

        public string AttendFuneral { get { return Case.AttendFuneral; } set { if (Case.AttendFuneral != value) { Case.AttendFuneral = value; RaisePropertyChanged("AttendFuneral"); } } }
        public string FuneralNameDeceased1 { get { return Case.FuneralNameDeceased1; } set { if (Case.FuneralNameDeceased1 != value) { Case.FuneralNameDeceased1 = value; RaisePropertyChanged("FuneralNameDeceased1"); } } }
        public string FuneralNameDeceased2 { get { return Case.FuneralNameDeceased2; } set { if (Case.FuneralNameDeceased2 != value) { Case.FuneralNameDeceased2 = value; RaisePropertyChanged("FuneralNameDeceased2"); } } }
        public string FuneralRelationDeceased1 { get { return Case.FuneralRelationDeceased1; } set { if (Case.FuneralRelationDeceased1 != value) { Case.FuneralRelationDeceased1 = value; RaisePropertyChanged("FuneralRelationDeceased1"); } } }
        public string FuneralRelationDeceased2 { get { return Case.FuneralRelationDeceased2; } set { if (Case.FuneralRelationDeceased2 != value) { Case.FuneralRelationDeceased2 = value; RaisePropertyChanged("FuneralRelationDeceased2"); } } }
        public DateTime? FuneralStartDate1 { get { return Case.FuneralStartDate1; } set { if (Case.FuneralStartDate1 != value) { Case.FuneralStartDate1 = value; RaisePropertyChanged("FuneralStartDate1"); } } }
        public DateTime? FuneralStartDate2 { get { return Case.FuneralStartDate2; } set { if (Case.FuneralStartDate2 != value) { Case.FuneralStartDate2 = value; RaisePropertyChanged("FuneralStartDate2"); } } }
        public DateTime? FuneralEndDate1 { get { return Case.FuneralEndDate1; } set { if (Case.FuneralEndDate1 != value) { Case.FuneralEndDate1 = value; RaisePropertyChanged("FuneralEndDate1"); } } }
        public DateTime? FuneralEndDate2 { get { return Case.FuneralEndDate2; } set { if (Case.FuneralEndDate2 != value) { Case.FuneralEndDate2 = value; RaisePropertyChanged("FuneralEndDate2"); } } }
        public string FuneralVillage1 { get { return Case.FuneralVillage1; } set { if (Case.FuneralVillage1 != value) { Case.FuneralVillage1 = value; RaisePropertyChanged("FuneralVillage1"); } } }
        public string FuneralVillage2 { get { return Case.FuneralVillage2; } set { if (Case.FuneralVillage2 != value) { Case.FuneralVillage2 = value; RaisePropertyChanged("FuneralVillage2"); } } }
        public string FuneralDistrict1 { get { return Case.FuneralDistrict1; } set { if (Case.FuneralDistrict1 != value) { Case.FuneralDistrict1 = value; RaisePropertyChanged("FuneralDistrict1"); } } }
        public string FuneralDistrict2 { get { return Case.FuneralDistrict2; } set { if (Case.FuneralDistrict2 != value) { Case.FuneralDistrict2 = value; RaisePropertyChanged("FuneralDistrict2"); } } }
        public string FuneralTouchBody1 { get { return Case.FuneralTouchBody1; } set { if (Case.FuneralTouchBody1 != value) { Case.FuneralTouchBody1 = value; RaisePropertyChanged("FuneralTouchBody1"); } } }
        public string FuneralTouchBody2 { get { return Case.FuneralTouchBody2; } set { if (Case.FuneralTouchBody2 != value) { Case.FuneralTouchBody2 = value; RaisePropertyChanged("FuneralTouchBody2"); } } }

        public string Travel { get { return Case.Travel; } set { if (Case.Travel != value) { Case.Travel = value; RaisePropertyChanged("Travel"); } } }
        public string TravelVillage { get { return Case.TravelVillage; } set { if (Case.TravelVillage != value) { Case.TravelVillage = value; RaisePropertyChanged("TravelVillage"); } } }
        public string TravelDistrict { get { return Case.TravelDistrict; } set { if (Case.TravelDistrict != value) { Case.TravelDistrict = value; RaisePropertyChanged("TravelDistrict"); } } }
        public DateTime? TravelStartDate { get { return Case.TravelStartDate; } set { if (Case.TravelStartDate != value) { Case.TravelStartDate = value; RaisePropertyChanged("TravelStartDate"); } } }
        public DateTime? TravelEndDate { get { return Case.TravelEndDate; } set { if (Case.TravelEndDate != value) { Case.TravelEndDate = value; RaisePropertyChanged("TravelEndDate"); } } }
        public bool TravelDateEstimated { get { return Case.TravelDateEstimated; } set { if (Case.TravelDateEstimated != value) { Case.TravelDateEstimated = value; RaisePropertyChanged("TravelDateEstimated"); } } }

        public string HospitalBeforeIll { get { return Case.HospitalBeforeIll; } set { if (Case.HospitalBeforeIll != value) { Case.HospitalBeforeIll = value; RaisePropertyChanged("HospitalBeforeIll"); } } }
        public string HospitalBeforeIllPatient { get { return Case.HospitalBeforeIllPatient; } set { if (Case.HospitalBeforeIllPatient != value) { Case.HospitalBeforeIllPatient = value; RaisePropertyChanged("HospitalBeforeIllPatient"); } } }
        public string HospitalBeforeIllHospitalName { get { return Case.HospitalBeforeIllHospitalName; } set { if (Case.HospitalBeforeIllHospitalName != value) { Case.HospitalBeforeIllHospitalName = value; RaisePropertyChanged("HospitalBeforeIllHospitalName"); } } }
        public string HospitalBeforeIllVillage { get { return Case.HospitalBeforeIllVillage; } set { if (Case.HospitalBeforeIllVillage != value) { Case.HospitalBeforeIllVillage = value; RaisePropertyChanged("HospitalBeforeIllVillage"); } } }
        public string HospitalBeforeIllDistrict { get { return Case.HospitalBeforeIllDistrict; } set { if (Case.HospitalBeforeIllDistrict != value) { Case.HospitalBeforeIllDistrict = value; RaisePropertyChanged("HospitalBeforeIllDistrict"); } } }
        public DateTime? HospitalBeforeIllStartDate { get { return Case.HospitalBeforeIllStartDate; } set { if (Case.HospitalBeforeIllStartDate != value) { Case.HospitalBeforeIllStartDate = value; RaisePropertyChanged("HospitalBeforeIllStartDate"); } } }
        public DateTime? HospitalBeforeIllEndDate { get { return Case.HospitalBeforeIllEndDate; } set { if (Case.HospitalBeforeIllEndDate != value) { Case.HospitalBeforeIllEndDate = value; RaisePropertyChanged("HospitalBeforeIllEndDate"); } } }
        public bool HospitalBeforeIllDateEstimated { get { return Case.HospitalBeforeIllDateEstimated; } set { if (Case.HospitalBeforeIllDateEstimated != value) { Case.HospitalBeforeIllDateEstimated = value; RaisePropertyChanged("HospitalBeforeIllDateEstimated"); } } }

        public string TraditionalHealer { get { return Case.TraditionalHealer; } set { if (Case.TraditionalHealer != value) { Case.TraditionalHealer = value; RaisePropertyChanged("TraditionalHealer"); } } }
        public string TraditionalHealerName { get { return Case.TraditionalHealerName; } set { if (Case.TraditionalHealerName != value) { Case.TraditionalHealerName = value; RaisePropertyChanged("TraditionalHealerName"); } } }
        public string TraditionalHealerVillage { get { return Case.TraditionalHealerVillage; } set { if (Case.TraditionalHealerVillage != value) { Case.TraditionalHealerVillage = value; RaisePropertyChanged("TraditionalHealerVillage"); } } }
        public string TraditionalHealerDistrict { get { return Case.TraditionalHealerDistrict; } set { if (Case.TraditionalHealerDistrict != value) { Case.TraditionalHealerDistrict = value; RaisePropertyChanged("TraditionalHealerDistrict"); } } }
        public DateTime? TraditionalHealerDate { get { return Case.TraditionalHealerDate; } set { if (Case.TraditionalHealerDate != value) { Case.TraditionalHealerDate = value; RaisePropertyChanged("TraditionalHealerDate"); } } }
        public bool TraditionalHealerDateEstimated { get { return Case.TraditionalHealerDateEstimated; } set { if (Case.TraditionalHealerDateEstimated != value) { Case.TraditionalHealerDateEstimated = value; RaisePropertyChanged("TraditionalHealerDateEstimated"); } } }

        public string Animals { get { return Case.Animals; } set { if (Case.Animals != value) { Case.Animals = value; RaisePropertyChanged("Animals"); } } }
        public bool AnimalBats { get { return Case.AnimalBats; } set { if (Case.AnimalBats != value) { Case.AnimalBats = value; RaisePropertyChanged("AnimalBats"); } } }
        public bool AnimalPrimates { get { return Case.AnimalPrimates; } set { if (Case.AnimalPrimates != value) { Case.AnimalPrimates = value; RaisePropertyChanged("AnimalPrimates"); } } }
        public bool AnimalRodents { get { return Case.AnimalRodents; } set { if (Case.AnimalRodents != value) { Case.AnimalRodents = value; RaisePropertyChanged("AnimalRodents"); } } }
        public bool AnimalPigs { get { return Case.AnimalPigs; } set { if (Case.AnimalPigs != value) { Case.AnimalPigs = value; RaisePropertyChanged("AnimalPigs"); } } }
        public bool AnimalBirds { get { return Case.AnimalBirds; } set { if (Case.AnimalBirds != value) { Case.AnimalBirds = value; RaisePropertyChanged("AnimalBirds"); } } }
        public bool AnimalCows { get { return Case.AnimalCows; } set { if (Case.AnimalCows != value) { Case.AnimalCows = value; RaisePropertyChanged("AnimalCows"); } } }
        public bool AnimalOther { get { return Case.AnimalOther; } set { if (Case.AnimalOther != value) { Case.AnimalOther = value; RaisePropertyChanged("AnimalOther"); } } }

        public string AnimalBatsStatus { get { return Case.AnimalBatsStatus; } set { if (Case.AnimalBatsStatus != value) { Case.AnimalBatsStatus = value; RaisePropertyChanged("AnimalBatsStatus"); } } }
        public string AnimalPrimatesStatus { get { return Case.AnimalPrimatesStatus; } set { if (Case.AnimalPrimatesStatus != value) { Case.AnimalPrimatesStatus = value; RaisePropertyChanged("AnimalPrimatesStatus"); } } }
        public string AnimalRodentsStatus { get { return Case.AnimalRodentsStatus; } set { if (Case.AnimalRodentsStatus != value) { Case.AnimalRodentsStatus = value; RaisePropertyChanged("AnimalRodentsStatus"); } } }
        public string AnimalPigsStatus { get { return Case.AnimalPigsStatus; } set { if (Case.AnimalPigsStatus != value) { Case.AnimalPigsStatus = value; RaisePropertyChanged("AnimalPigsStatus"); } } }
        public string AnimalBirdsStatus { get { return Case.AnimalBirdsStatus; } set { if (Case.AnimalBirdsStatus != value) { Case.AnimalBirdsStatus = value; RaisePropertyChanged("AnimalBirdsStatus"); } } }
        public string AnimalCowsStatus { get { return Case.AnimalCowsStatus; } set { if (Case.AnimalCowsStatus != value) { Case.AnimalCowsStatus = value; RaisePropertyChanged("AnimalCowsStatus"); } } }
        public string AnimalOtherStatus { get { return Case.AnimalOtherStatus; } set { if (Case.AnimalOtherStatus != value) { Case.AnimalOtherStatus = value; RaisePropertyChanged("AnimalOtherStatus"); } } }
        public string AnimalOtherComment { get { return Case.AnimalOtherComment; } set { if (Case.AnimalOtherComment != value) { Case.AnimalOtherComment = value; RaisePropertyChanged("AnimalOtherComment"); } } }

        public string BittenTick { get { return Case.BittenTick; } set { if (Case.BittenTick != value) { Case.BittenTick = value; RaisePropertyChanged("BittenTick"); } } }

        public string InterviewerName { get { return Case.InterviewerName; } set { if (Case.InterviewerName != value) { Case.InterviewerName = value; RaisePropertyChanged("InterviewerName"); } } }
        public string InterviewerPhone { get { return Case.InterviewerPhone; } set { if (Case.InterviewerPhone != value) { Case.InterviewerPhone = value; RaisePropertyChanged("InterviewerPhone"); } } }
        public string InterviewerEmail { get { return Case.InterviewerEmail; } set { if (Case.InterviewerEmail != value) { Case.InterviewerEmail = value; RaisePropertyChanged("InterviewerEmail"); } } }
        public string InterviewerPosition { get { return Case.InterviewerPosition; } set { if (Case.InterviewerPosition != value) { Case.InterviewerPosition = value; RaisePropertyChanged("InterviewerPosition"); } } }
        public string InterviewerDistrict { get { return Case.InterviewerDistrict; } set { if (Case.InterviewerDistrict != value) { Case.InterviewerDistrict = value; RaisePropertyChanged("InterviewerDistrict"); } } }
        public string InterviewerHealthFacility { get { return Case.InterviewerHealthFacility; } set { if (Case.InterviewerHealthFacility != value) { Case.InterviewerHealthFacility = value; RaisePropertyChanged("InterviewerHealthFacility"); } } }
        public string InterviewerInfoProvidedBy { get { return Case.InterviewerInfoProvidedBy; } set { if (Case.InterviewerInfoProvidedBy != value) { Case.InterviewerInfoProvidedBy = value; RaisePropertyChanged("InterviewerInfoProvidedBy"); } } }
        public string ProxyName { get { return Case.ProxyName; } set { if (Case.ProxyName != value) { Case.ProxyName = value; RaisePropertyChanged("ProxyName"); } } }
        public string ProxyRelation { get { return Case.ProxyRelation; } set { if (Case.ProxyRelation != value) { Case.ProxyRelation = value; RaisePropertyChanged("ProxyRelation"); } } }

        public string CommentsOnThisPatient { get { return Case.CommentsOnThisPatient; } set { if (Case.CommentsOnThisPatient != value) { Case.CommentsOnThisPatient = value; RaisePropertyChanged("CommentsOnThisPatient"); } } }

        #endregion // Properties
        
        public delegate void EpiCaseDefinitionChangingHandler(object sender, EpiCaseDefinitionChangingEventArgs e);
        public delegate void FieldValueChangingHandler(object sender, FieldValueChangingEventArgs e);

        public event EpiCaseDefinitionChangingHandler EpiCaseDefinitionChanging;
        public event FieldValueChangingHandler CaseIDChanging;

        public override string ToString()
        {
            return ID + " : " + Surname + ", " + OtherNames + " : " + GenderAbbreviation + " : " + EpiCaseDef;
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                EpiCaseDefinitionChanging = null;
                CaseIDChanging = null;
            }
            // free native resources if there are any.
        }

        public CaseViewModel()
        {
            Case = new Case();
        }

        public CaseViewModel(Case newCase)
        {
            Case = new Case();
            UpdateCase(newCase);
        }

        public CaseViewModel(ContactViewModel contactVM, int uniqueKey)
        {
            Case = new Case();
            CreateCaseFromContact(contactVM, uniqueKey);
        }

        private void CreateCaseFromContact(ContactViewModel contactVM, int uniqueKey)
        {
            this.AgeUnit = contactVM.AgeUnit;
            this.Age = contactVM.Age;
            this.HeadOfHousehold = contactVM.HeadOfHousehold;
            this.District = contactVM.District;
            this.Gender = contactVM.Gender;
            this.IsContact = true;
            this.OtherNames = contactVM.OtherNames;
            this.RecordId = contactVM.Contact.RecordId;
            Case.UniqueKey = uniqueKey;
            this.SubCounty = contactVM.SubCounty;
            this.Surname = contactVM.Surname;
            this.Village = contactVM.Village;
            //if (contactVM.HCW == "Yes")
            //{
            //    this.IsHCW = true;
            //}
            //else if (contactVM.HCW == "No")
            //{
            //    this.IsHCW = false;
            //}
        }

        public void UpdateCase(Case updatedCase)
        {
            this.AgeUnit = updatedCase.AgeUnit;
            this.Age = updatedCase.Age;
            this.HeadOfHousehold = updatedCase.HeadOfHousehold;
            this.DateDeath = updatedCase.DateDeath;
            this.DateDeathEst = updatedCase.DateDeathEst;
            this.DateOnsetEst = updatedCase.DateOnsetEst;
            this.DateDischargeIso = updatedCase.DateDischargeIso;
            this.DateIsolationCurrent = updatedCase.DateIsolationCurrent;
            this.DateOnset = updatedCase.DateOnset;
            this.DateReport = updatedCase.DateReport;
            this.District = updatedCase.District;
            this.DistrictOnset = updatedCase.DistrictOnset;
            this.DistrictHosp = updatedCase.DistrictHosp;
            this.Country = updatedCase.Country;
            this.CountryOnset = updatedCase.CountryOnset;
            this.EpiCaseDef = updatedCase.EpiCaseDef;
            this.FinalLabClass = updatedCase.FinalLabClass;
            this.FinalStatus = updatedCase.FinalStatus;
            this.CurrentStatus = updatedCase.CurrentStatus;
            this.Gender = updatedCase.Gender;
            this.ID = updatedCase.ID;
            this.IsContact = updatedCase.IsContact;
            this.OtherNames = updatedCase.OtherNames;
            this.RecordId = updatedCase.RecordId;
            this.RecordStatus = updatedCase.RecordStatus;
            this.SubCounty = updatedCase.SubCounty;
            this.SubCountyHosp = updatedCase.SubCountyHosp;
            this.Surname = updatedCase.Surname;
            this.IsolationCurrent = updatedCase.IsolationCurrent;
            Case.UniqueKey = updatedCase.UniqueKey;
            this.Village = updatedCase.Village;
            this.VillageHosp = updatedCase.VillageHosp;
            this.Parish = updatedCase.Parish;
            this.IsHCW = updatedCase.IsHCW;
            this.PlaceOfDeath = updatedCase.PlaceOfDeath;
            this.DateLastLabSampleCollected = updatedCase.DateLastLabSampleCollected;
            this.DateLastLabSampleTested = updatedCase.DateLastLabSampleTested;
            this.LastSampleInterpretation = updatedCase.LastSampleInterpretation;
            this.LastSamplePCRResult = updatedCase.LastSamplePCRResult;
            this.CurrentHospital = updatedCase.CurrentHospital;
            this.DateHospitalCurrentAdmit = updatedCase.DateHospitalCurrentAdmit;

            this.DateOutcomeInfoCompleted = updatedCase.DateOutcomeInfoCompleted;
            this.BleedUnexplainedEver = updatedCase.BleedUnexplainedEver;
            this.SpecifyBleeding = updatedCase.SpecifyBleeding;
            this.HospitalDischarge = updatedCase.HospitalDischarge;
            this.HospitalDischargeDistrict = updatedCase.HospitalDischargeDistrict;
            this.DateDischargeIsoEst = updatedCase.DateDischargeIsoEst;
            this.DateDischargeHospital = updatedCase.DateDischargeHospital;
            this.DateDischargeHospitalEst = updatedCase.DateDischargeHospitalEst;
            this.DateDeath2 = updatedCase.DateDeath2;
            this.DateDeath2Est = updatedCase.DateDeath2Est;
            this.DateDeath2EstSpecify = updatedCase.DateDeath2EstSpecify;
            this.PlaceDeath = updatedCase.PlaceDeath;
            this.HospitalDeath = updatedCase.HospitalDeath;
            this.PlaceDeathOther = updatedCase.PlaceDeathOther;
            this.VillageDeath = updatedCase.VillageDeath;
            this.SubCountyDeath = updatedCase.SubCountyDeath;
            this.DistrictDeath = updatedCase.DistrictDeath;
            this.DateFuneral = updatedCase.DateFuneral;
            this.FuneralConductedFam = updatedCase.FuneralConductedFam;
            this.FuneralConductedOutbreakTeam = updatedCase.FuneralConductedOutbreakTeam;
            this.VillageFuneral = updatedCase.VillageFuneral;
            this.SubCountyFuneral = updatedCase.SubCountyFuneral;
            this.DistrictFuneral = updatedCase.DistrictFuneral;

            this.OriginalID = updatedCase.OriginalID;

            this.SymptomFever = updatedCase.SymptomFever;
            this.SymptomFeverTemp = updatedCase.SymptomFeverTemp;
            this.SymptomFeverTempSource = updatedCase.SymptomFeverTempSource;
            this.SymptomVomiting = updatedCase.SymptomVomiting;
            this.SymptomDiarrhea = updatedCase.SymptomDiarrhea;
            this.SymptomFatigue = updatedCase.SymptomFatigue;
            this.SymptomAnorexia = updatedCase.SymptomAnorexia;
            this.SymptomAbdPain = updatedCase.SymptomAbdPain;
            this.SymptomChestPain = updatedCase.SymptomChestPain;
            this.SymptomMusclePain = updatedCase.SymptomMusclePain;
            this.SymptomJointPain = updatedCase.SymptomJointPain;
            this.SymptomHeadache = updatedCase.SymptomHeadache;
            this.SymptomCough = updatedCase.SymptomCough;
            this.SymptomDiffBreathe = updatedCase.SymptomDiffBreathe;
            this.SymptomDiffSwallow = updatedCase.SymptomDiffSwallow;
            this.SymptomSoreThroat = updatedCase.SymptomSoreThroat;
            this.SymptomJaundice = updatedCase.SymptomJaundice;
            this.SymptomConjunctivitis = updatedCase.SymptomConjunctivitis;
            this.SymptomRash = updatedCase.SymptomRash;
            this.SymptomHiccups = updatedCase.SymptomHiccups;
            this.SymptomPainEyes = updatedCase.SymptomPainEyes;
            this.SymptomUnconscious = updatedCase.SymptomUnconscious;
            this.SymptomConfused = updatedCase.SymptomConfused;
            this.SymptomOtherHemo = updatedCase.SymptomOtherHemo;
            this.SymptomOtherHemoSpecify = updatedCase.SymptomOtherHemoSpecify;

            this.SymptomFeverFinal = updatedCase.SymptomFeverFinal;
            this.SymptomFeverTempFinal = updatedCase.SymptomFeverTempFinal;
            this.SymptomFeverTempSourceFinal = updatedCase.SymptomFeverTempSourceFinal;
            this.SymptomVomitingFinal = updatedCase.SymptomVomitingFinal;
            this.SymptomDiarrheaFinal = updatedCase.SymptomDiarrheaFinal;
            this.SymptomFatigueFinal = updatedCase.SymptomFatigueFinal;
            this.SymptomAnorexiaFinal = updatedCase.SymptomAnorexiaFinal;
            this.SymptomAbdPainFinal = updatedCase.SymptomAbdPainFinal;
            this.SymptomChestPainFinal = updatedCase.SymptomChestPainFinal;
            this.SymptomMusclePainFinal = updatedCase.SymptomMusclePainFinal;
            this.SymptomJointPainFinal = updatedCase.SymptomJointPainFinal;
            this.SymptomHeadacheFinal = updatedCase.SymptomHeadacheFinal;
            this.SymptomCoughFinal = updatedCase.SymptomCoughFinal;
            this.SymptomDiffBreatheFinal = updatedCase.SymptomDiffBreatheFinal;
            this.SymptomDiffSwallowFinal = updatedCase.SymptomDiffSwallowFinal;
            this.SymptomSoreThroatFinal = updatedCase.SymptomSoreThroatFinal;
            this.SymptomJaundiceFinal = updatedCase.SymptomJaundiceFinal;
            this.SymptomConjunctivitisFinal = updatedCase.SymptomConjunctivitisFinal;
            this.SymptomRashFinal = updatedCase.SymptomRashFinal;
            this.SymptomHiccupsFinal = updatedCase.SymptomHiccupsFinal;
            this.SymptomPainEyesFinal = updatedCase.SymptomPainEyesFinal;
            this.SymptomUnconsciousFinal = updatedCase.SymptomUnconsciousFinal;
            this.SymptomConfusedFinal = updatedCase.SymptomConfusedFinal;
            this.SymptomOtherHemoFinal = updatedCase.SymptomOtherHemoFinal;
            this.SymptomOtherHemoFinalSpecify = updatedCase.SymptomOtherHemoFinalSpecify;
        }

        #region Commands
        void UpdateExecute(Case updatedCase)
        {
            UpdateCase(updatedCase);
        }

        public ICommand Update { get { return new RelayCommand<Case>(UpdateExecute); } }
        #endregion
    }
}
